from django.db import models



class Classification(models.Model):
    type = models.CharField(max_length = 50)

    def __unicode__(self):
        return self.type

class Log(models.Model):
    title = models.CharField(max_length = 30)
    content = models.CharField(max_length = 3000)
    date = models.DateField()
    type = models.CharField(max_length = 30)
    log_foreign = models.ForeignKey(Classification)
    label = models.CharField(max_length = 30)

    def __unicode__(self):
        return u'%s %s' % (self.title, self.date)


class Comment(models.Model):
    nickname = models.CharField(max_length=30)
    comment = models.CharField(max_length=3000)
    porfile = models.URLField(blank=True)
    date = models.DateField()
    email = models.EmailField(blank=True, verbose_name='e-mail')
    log = models.ForeignKey(Log)

    def __unicode__(self):
        return self.nickname

class Reply(models.Model):
    reply_to_comment = models.CharField(max_length=100)
    date = models.DateField()
    reply_to_nickname = models.CharField(max_length=20)
    comment_foreign = models.ForeignKey(Comment)

    def __unicode__(self):
        return self.reply_to_nickname

#    def __unicode__(self):
#        renturn u'%s %s' % (self.title, self.content)

class Member(models.Model):
    username = models.CharField(max_length=10)
    password = models.CharField(max_length=10)

class Personal_information(models.Model):
    information = models.CharField(max_length=20)
    
    def __unicode__(slef):
        return self.information

class Contact(models.Model):
    liaison = models.CharField(max_length=50)

    def __unicode__(self):
        return self.liaison

class About_me(models.Model):
    aboutme = models.CharField(max_length=200)
    signature = models.CharField(max_length=150)
    
    def __unicode__(self):
        return self.aboutme